<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/cms/block/addblock" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page">
    <div class="page-hd">
      <if condition="empty($findBlock)">
        <h1>添加区块</h1>
        <else/>
        <h1>修改区块</h1>
      </if>
    </div>
    <if condition="empty($findBlock)">
      <form id="J_form" action="{:URL('cms/Block/doaddblock')}" method="POST" id="validateForm">
        <else/>
        <form id="J_form" action="{:URL('cms/Block/doupdateblock')}" method="POST" id="validateForm">
    </if>
    <input type="hidden" name="id" id="id" value="{$id}" />
    <input type="hidden" name="tid" id="tid" value="{$tid}" />
    <input type="hidden" name="blockid" id="blockid" value="{$blockid}" />
    <div class="form">
      <dl class="kv">
        <dt>
          <label>区块名称：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="blockname" id="blockname" value="{$findBlock.name}" required />
          <font color="red">*</font>
          <div class="kv-error"></div>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>区块类型：</label>
        </dt>
        <dd>
          <select name="type" id="btn-select" class="input-text">
              <option value="1" <eq name="findBlock['type']" value="1">selected</eq>>普通区块</option>
              <option value="2" <eq name="findBlock['type']" value="2">selected</eq>>静态区块</option>
          </select>
          <div class="kv-error"></div>
        </dd>
      </dl>
      <dl class="kv" id="row-number" <eq name="findBlock['type']" value="2">style="display:none"</eq>>
        <dt>
          <label>生成笔数：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="number" id="number" value="{$findBlock.number}" />
          <div class="kv-error"></div>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>模版：</label>
        </dt>
        <dd>
          <textarea rows="20" cols="100" name="template" id="template" required>{$findBlock.template}</textarea>
          <font color="red">*</font>
          <div class="kv-error"></div>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>备注：</label>
        </dt>
        <dd>
          <textarea rows="5" cols="100" name="remark">{$findBlock.remark}</textarea>
        </dd>
      </dl>
      <div class="actions">
        <if condition="empty($findBlock)">
          <input class="btn btn-y" type="submit" value="添加" />
          <else/>
          <input class="btn btn-y" type="submit" value="修改" />
        </if>
        <input class="btn btn-n" type="button" value="取消" onclick="javascript:history.go(-1);">
      </div>
    </div>
    </form>
  </div>
</body>

</html>
